import request from '@/utils/request'
/**
 * 获取组织架构数据
 *  */
export const reqGetDepartments = () => {
  return request({
    methods: 'get',
    url: '/company/department'
  })
}
/**
 * 根据id删除部门
 **/
export const reqDelDepartments = (id) => {
  return request({
    method: 'delete',
    url: `/company/department/${id}`
  })
}

/**
 * 添加部门(注意需要五个字段, pid)
 */
export const reqAddDepartment = (form) => {
  return request({
    method: 'post',
    url: '/company/department',
    data: form
  })
}
/**
 * 根据id查询部门详情
 */
export const reqGetDepartDetail = (id) => {
  return request({
    method: 'get',
    url: `/company/department/${id}`
  })
}
/**
 * 根据ID修改部门详情
 */
export const reqUpdateDepartDetail = (form) => {
  return request({
    method: 'put',
    url: `/company/department/${form.id}`,
    data: form

  })
}
